import { Component,OnInit } from '@angular/core';
import type { EChartsOption } from 'echarts';

@Component({
  selector: 'app-page-home',
  templateUrl: './page-home.component.html',
  styleUrls: ['./page-home.component.scss']
})
export class PageHomeComponent implements OnInit {
  
  options: EChartsOption={};

  ngOnInit(): void {
    const xAxisData = [];
    const data1 = [];
    const data2 = [];

    for (let i = 0; i < 100; i++) {
      xAxisData.push('category' + i);
      data1.push((Math.sin(i / 5) * (i / 5 - 10) + i / 6) * 5);
      data2.push((Math.cos(i / 5) * (i / 5 - 10) + i / 6) * 5);
    }

    this.options = {
      legend: {
        data: ['bar', 'bar2'],
        align: 'left',
      },
      tooltip: {},
      xAxis: {
        data: xAxisData,
        silent: false,
        splitLine: {
          show: false,
        },
      },
      yAxis: {},
      series: [
        {
          name: 'bar',
          type: 'bar',
          data: data1,
          animationDelay: idx => idx * 10,
        },
        {
          name: 'bar2',
          type: 'bar',
          data: data2,
          animationDelay: idx => idx * 10 + 100,
        },
      ],
      animationEasing: 'elasticOut',
      animationDelayUpdate: idx => idx * 5,
    };
  }

  list = [
        { studentId:"5220563",age:20,ischeck:false,name:"章邦炫",mobile:"18679767151",gitee:"18679767151"},
        { studentId:"5220534",age:18,ischeck:false,name:"翟方强",mobile:"18279483885",gitee:"18279483885"},
        { studentId:"5220533",age:16,ischeck:true,name:"祝仕杰",mobile:"15079483974",gitee:"15079483974"},
        { studentId:"5220879",age:10,ischeck:false,name:"杨慧平",mobile:"19914569464",gitee:"19914569464"},
  ]
  checkIn(student:any){
    student.ischeck = true;
  }
}
